﻿using Ado.Interface;
using Ado.MsSql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Factory
{
    public class SimpleDbHelperFactory
    {
        #region 创建IDbHelper的实例+IDbHelper Create(DbHelperTypeEnum type)
        /// <summary>
        /// 创建IDbHelper的实例
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static IDbHelper Create(DbHelperTypeEnum type)
        {
            IDbHelper dbHelper = null;
            switch (type)
            {
                case DbHelperTypeEnum.MsSql:
                    dbHelper = new SqlHelper();
                    break;
                default:
                    throw new Exception("此类型未找到！");
            }
            return dbHelper;
        } 
        #endregion
        public enum DbHelperTypeEnum
        {
            MsSql
        }
    }
}
